/**
 * Created by 静静 on 2016/9/28.
 */
function onLogin() {
    var userId = $("#userId").val();
    var password = $("#passwordId").val();

    $.ajax({
        url: "/login",
        type: "post",
        data: {
            uid: userId,
            pswd: password
        },
        success: function (txt) {
            console.log(txt);
            var res = txt;
            if (res.status == 0) {
                var token = res.data;
                $.cookie("token", token);
                window.location = "chat.html";
            }
            else {
                alert("错误！！！");
            }
        }
    });
}
